package com.yehongyu.mytools.basic.jdk5;

import java.util.HashMap;
import java.util.Map;

public class JDK5_001_ClassTemplate<T> {

	public String test(T a, T b) {
		return a.toString() + b.toString();
	}
	
	public static Map<String, String> getHashMap() {
		Map<String, String> map = new HashMap<String, String>();
		map.put("a", "aValue");
		map.put("b", "bValue");
		//map.put("c", new Integer(1));
		//map.put(new Integer(4), "dValue");
		return map;
	}
	
	public static void main(String[] args) {
		JDK5_001_ClassTemplate<String> obj = new JDK5_001_ClassTemplate<String>();
		System.out.println(obj.test("a", "b"));
		
		JDK5_001_ClassTemplate<Integer> obj2 = new JDK5_001_ClassTemplate<Integer>();
		System.out.println(obj2.test(new Integer(1), new Integer(2)));
		
		Map<String, String> map = getHashMap();
		String value = map.get("a");
		System.out.println(value);
	}
}
